<div class="ui-portlet clearfix ">
	<ul  class="editor-template-list ui-portlet-list">
		
	{{loop $datalist['rows'] $item}}
		<li class="col-sm-4">
		<div style="border:1px solid #ddd;padding:15px;margin: 15px;">
			{{if $item['coverimg'] }}
				{{if $item['cover_width']}}
					<div style="width:{{$item['cover_width']}}px">{{$item['coverimg']}}</div>
				{{else}}
					{{$item['coverimg']}}
				{{/if}}
			{{else}}					
				<section class="_135editor" data-tools="135编辑器" data-id="{{$item['id']}}">{{html_entity_decode($item['content'])}}</section>
			{{/if}}
				<div>
				    <a class="btn btn-primary" href="{{Router::url('/admin/editor_styles/edit/'.$item['id'])}}" target="_blank">
				    		<i class="fa fa-edit"></i> 编辑	</a>							
				</div>
		</div>
			</li>
	{{/loop}}
	</ul>
</div>

{{$this->Html->script(array(
            'jquery/jquery.masonry.min.js','jquery/jquery.infinitescroll.min.js',
            'jquery/jquery.lazyload.js',            
        ));
}}
<script>

$(function(){
	 
	    var $container = $('.ceditor-template-list');  
	    //$container.imagesLoaded( function(){
	      $container.masonry({
	        itemSelector: '.col-sm-4',
	        animate: true,       
	        animationOptions: {
	            duration: 400,
	            easing: 'linear',
	            queue: false
	        }
	      });
	    //});
	  
});

</script>